<TITLE>Opening</TITLE>


<H1>Step 1: Open the file</H1>


The first step in any Quicktime operation is to open the file.  Include
the Quicktime header:<P>

<CODE>
#include &#60quicktime.h&#62
</CODE><P>

create a quicktime pointer:<P>

<CODE>
quicktime_t *file;<P>
</CODE>

and open the file in read only, read/write, or write mode.  The
following code opens a file in read only:<P>

<CODE>
file = quicktime_open("test.mov", 1, 0));<P>
</CODE><P>

Argument 1 is the path to a file.  Argument 2 is a flag for read
access.  Argument 3 is a flag for write access.  You can specify read,
read/write or write access by setting these flags.  Only specify
read/write for creating new files.  Opening an existing file in
read/write mode destroys the file.<P>

quicktime_open returns a NULL if the file couldn't be opened or the
format couldn't be recognized.  Now you can do all sorts of operations
on the file.<P>



When you're done doing whatever you do, call<P>

<CODE>
quicktime_close(quicktime_t *file);<BR>
</CODE>
<P>
<P>

